using Microsoft.Practices.Unity;
using System.Web.Http;
using SDCloudSolution.SDCloud.BusinessLayer.Identity;
using SDCloudSolution.SDCloud.BusinessLayer.Interfaces;
using SDCloudSolution.SDCloud.DataLayer.Identity;
using SDCloudSolution.SDCloud.DataLayer.Interfaces;
using SDCloudSolution.SDCloud.WebApi.IoC;
using Unity.WebApi;

namespace SDCloudSolution.SDCloud.WebApi
{
    public static class UnityConfig
    {
        public static void RegisterComponents()
        {
			var container = new UnityContainer();

            container.RegisterType<IIdentityDbConnectionStringProvider, ApplicationSettingsProvider>();
            container.RegisterType<IClientApplicationDataProvider, ClientApplicationDataProvider>();
            container.RegisterType<IClientApplicationComponent, ClientApplicationComponent>();
            
            GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
        }
    }
}